<?php

/* @var $this \yii\web\View */
/* @var $content string */

use yii\helpers\Url;
use yii\helpers\Html;
use common\helpers\Render;
use common\models\Article;

$articles = Article::find()->select('id, title, created_at')
    ->orderBy('id desc')->limit(9)
    ->asArray()->all();
?>

<div class="box-shadow pd-10px mb-20px">
    <div class="data-title sub"><i class="icon-bullhorn"></i> 新闻公告</div>
    <div class="artical-list simple">
        <?php foreach($articles as $article) { ?>
            <p><span class="fr cl-gray"><?= date('m-d', $article['created_at']) ?></span><i class="icon-caret-right"></i> <a href="<?= Url::to('@web/article/detail?id='.$article['id']) ?>"><?= Render::interceptHtml($article['title'], 14, '..') ?></a></p>
        <?php } ?>
    </div>
</div>